package com.lianwei.hospital.Service.Impl;

import com.lianwei.hospital.Service.DepartmentService;
import com.lianwei.hospital.mapper.DepartmentInfoMapper;
import com.lianwei.hospital.module.entity.DepartmentInfo;
import com.lianwei.hospital.module.entity.DoctorInfo;
import com.lianwei.hospital.module.vo.DepartmentVO;
import com.lianwei.hospital.utils.PageUtil;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;

import java.util.List;

@Service("DepartmentService")
public class DepartmentInfoImpl implements DepartmentService {
    @Autowired
    DepartmentInfoMapper departmentInfoMapper;

    @Override
    public DepartmentInfo selectByPrimaryKey(Integer id) throws Exception {
        return departmentInfoMapper.selectByPrimaryKey(id);
    }

    @Override
    public boolean insert(DepartmentInfo departmentInfo) throws Exception {
        return departmentInfoMapper.insert(departmentInfo)>0;
    }

    @Override
    public List<DepartmentInfo> selectAll() throws Exception {
        return departmentInfoMapper.selectAll();
    }

    @Override
    public boolean deleteByPrimaryKey(Integer id) throws Exception {
        return departmentInfoMapper.deleteByPrimaryKey(id)>0;
    }

    @Override
    public boolean updateByPrimaryKey(DepartmentInfo departmentInfo) throws Exception {
        return departmentInfoMapper.updateByPrimaryKey(departmentInfo)>0;
    }

}
